libxl: signal caller if domain already destroyed on domain death event
authorIan Campbell <ian.campbell@citrix.com>
Tue, 27 Jul 2010 15:58:51 +0000 (16:58 +0100)
committerIan Campbell <ian.campbell@citrix.com>
Tue, 27 Jul 2010 15:58:51 +0000 (16:58 +0100)
commit5213606b5694c33f35141356a7062f761373f466
tree591d00675f4de55d975c463758a73c18bb4bab75
parent1e01a066eb4a018428f372aea9e4f7ffaaa3747a
libxl: signal caller if domain already destroyed on domain death event

Currently libxl_event_get_domain_death_info returns 0 if the event was
not a domain death event and 1 if it was but does not infom the user
if someone else has already cleaned up the domain, which means the
caller must replicate some of the logic from within libxl.

Instead have the libxl_event_get_XXX_info functions required that the
event is of the right type (the caller must have recently switched on
event->type anyway).

This allows the return codes to be used in an event specific way and
we take advantage of this by returning an error from
libxl_event_get_domain_death_info if the domain is not dying.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
tools/libxl/libxl.c
tools/libxl/libxl.h
tools/libxl/xl_cmdimpl.c